<!DOCTYPE html>
<html>
<head>
    <base href="http://114.215.249.168:8080/IOT/">


    <title>牧中智慧畜牧业云平台GIS（地理）系统</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="description" content="This is my page">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <link href="css/iot_main.css" rel="stylesheet" type="text/css" />
    <link href="css/map.css" rel="stylesheet" type="text/css" />

    <link href="new_page_files/css/main.css" rel="stylesheet" type="text/css" />

    <link href="new_page_files/map/css/bootstrap.min.css" rel="stylesheet">
    <link href="new_page_files/map/css/shifan.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="new_page_files/map/js/html5shiv.js"></script>

    <![endif]-->


    <script src="//cdn.bootcss.com/jquery/1.12.0/jquery.min.js"></script>

    <script src="/webjars/js/bootstrap/dist/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="scripts/jquery.player.urlconfig.js?v=1.0.0"></script>
    <script type="text/javascript">var basePath = 'http://114.215.249.168:8080/IOT/';</script>
    <script type="text/javascript" src="scripts/jquery.eye2player.js?v=1.0"></script>
    <script type="text/javascript" src="scripts/jquery.hik8800player.js?v=1.0"></script>
    <script type="text/javascript" src="scripts/jquery.dhp2pplayer.js?v=1.0"></script>
    <script type="text/javascript" src="scripts/jquery.dhwebplayer.js?v=1.0"></script>
    <script type="text/javascript" src="scripts/jquery.hikysyplayer.js?v=1.0"></script>

    <script type="text/javascript" src="scripts/jquery.hik8200player.js?v=1.0"></script>
    <script type="text/javascript" src="scripts/jquery.hik9800player.js?v=1.0"></script>
    <script type="text/javascript"  src="scripts/jquery.dhdssplayer.js?v=1.0"></script>

    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=RXWeiguHDrFql3fKp4LLxAsu38IKA1ZB"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/library/RichMarker/1.2/src/RichMarker_min.js"></script>
    <script type="text/javascript" src="scripts/iot_map.js?v=1"></script>
    <script type="text/javascript" src="scripts/iot_company_config.js?v=1"></script>
    <script type="text/javascript" src="scripts/PagerTool_new.js?v=1"></script>
    <!-- 统计图表 -->
    <script type="text/javascript" src="scripts/echarts.js?v=1"></script>


    <script type="text/javascript" src="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.js"></script>
    <link rel="stylesheet" href="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.css" />
    <style type="text/css">
        *{margin: 0; padding: 0} body{background:#fff;  color:#222;font-size:14px; font-family:Tahoma; height:100%}
        html{ height:100%}li{ list-style:none;}a{ color:#399; text-decoration:none}a:hover{ color:#047373;text-decoration:none}
        img{ border:0}
        #baidu_map_content_div_id{width:250px;padding:10px;}
        #baidu_map_content_div_id li{padding:4px 0;color:#0f4581; font-size: 16px;}
        #baidu_map_content_div_id li span{ display:inline-block;width:80px; font-weight:700;color:#454545; font-size:14px;}
        #baidu_map_content_div_id li a{display:inline-block;width:98px; height:24px; line-height:24px; background:url(image/btn.png) no-repeat;color:#222; text-align:center;font-size:14px;color:#fff; font-weight:700}
        #baidu_map_content_div_id li a:hover{color:#fffab2}

        .BMap_bubble_content{width:250px;}
        #show_vedio{display: none; position: absolute; top: 25%; left: 22%; width: 600px; height: 420px; padding: 8px; border: 8px solid #E8E9F7; background-color: white; z-index:1002444444444; overflow: auto;}

        /********加载中的样式  Start*************/
        .spinner {
            margin:100px auto;

            width: 50px;
            height: 60px;
            text-align: center;
            font-size: 10px;
        }

        .spinner > div {
            background-color: #fff;
            height: 100%;
            width: 6px;
            display: inline-block;

            -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
            animation: stretchdelay 1.2s infinite ease-in-out;
        }

        .spinner .rect2 {
            -webkit-animation-delay: -1.1s;
            animation-delay: -1.1s;
        }

        .spinner .rect3 {
            -webkit-animation-delay: -1.0s;
            animation-delay: -1.0s;
        }

        .spinner .rect4 {
            -webkit-animation-delay: -0.9s;
            animation-delay: -0.9s;
        }

        .spinner .rect5 {
            -webkit-animation-delay: -0.8s;
            animation-delay: -0.8s;
        }

        @-webkit-keyframes stretchdelay {
            0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
            20% { -webkit-transform: scaleY(1.0) }
        }

        @keyframes stretchdelay {
            0%, 40%, 100% {
                transform: scaleY(0.4);
                -webkit-transform: scaleY(0.4);
            }  20% {
                   transform: scaleY(1.0);
                   -webkit-transform: scaleY(1.0);
               }
        }
        .searchmask {
            position: absolute;
            left:0;
            top:0;
            background:rgba(0,0,0,.7);
            filter: progid:DXImageTransform.Microsoft.Gradient(startColorstr=#66000000,endColorstr=#66000000);
            width:100%;
            height:536px;
            z-index:1102444444444;
        }

        /********加载中的样式  End*************/

    </style>
    <script language="javascript" for="HIK9800Player" event="EventNotify(event_type, wnd_index, param)">
        EventNotify(event_type, wnd_index, param);
    </script>

    <script language="javascript" for="HIKYSYPlayer" event="PluginEventHandler(lEventType, lParam1, lParam2, lUserData, errorCode)">
        PluginEventHandler("play_area",lEventType, lParam1, lParam2, lUserData, errorCode);
    </script>
    <script for="EYEPlayer" event="NotifyDeviceListMessage(sDeviceList);">
        EYE_NotifyDeviceListMessage(sDeviceList);
    </script>
    <script for="EYEPlayer" event="NotifyChannelMessage(sChannels);">
        EYE_NotifyChannelMessage(sChannels);
    </script>
    <script  for="EYEPlayer" event="ChangePlayWindowStatus(hWnd,lStatus,lType);">
        EYE_ChangePlayWindowStatus(hWnd,lStatus,lType);
    </script>
    <script   for="EYEPlayer" event="OnPTZControl(hWnd, lPTZCommand, sPuID, sChannelID);">
        EYE_HandlePtzControl(hWnd, lPTZCommand, sPuID, sChannelID);
    </script>
    <!-- 全球眼专用控件回调脚本区块 -->
    <script>
        //设备列表处理
        var channelist = [];
        var index_play=0;

        var eye_channels =[];
        function playFirstChannel(){
            PlayVideo(eye_channels[0],0)
        }
        function EYE_NotifyDeviceListMessage(cString)
        {
            eye_channels =[];
            parseVideoSite();
            setTimeout("playFirstChannel()",100);
        }

        //(Apply to DAHUAP2P、DAHUAWEB)Add by Tsd
        function DAHUAP2P_NotifyChannelMessage(channel_array){
            for (var j = 0;j < channel_array.length; j++) {
                var channelinfo=channel_array[j];
                if(j==0){
                    PlayVideo({'channelid':channelinfo.channelindex},0)
                }
            }
            $("#load_img").css("display","none");
        }

        function DAHUADSS_NotifyChannelMessage(channel_array){
            for (var j = 0;j < channel_array.length; j++) {
                var channelinfo=channel_array[j];
                if(j==0){
                    PlayVideo({'sn':channelinfo.sn,'name':channelinfo.name,'streamtype':channelinfo.streamtype,'mediatype':channelinfo.mediatype,'transtype':channelinfo.transtype},0)
                }
            }
            $("#load_img").css("display","none");
        }


        function EYE_NotifyChannelMessage(cString){
            //如果上面GetChannelList多次，即存在多个设备时，这里应该是在原来的树上增加通道内容
            var channel_array = cString.split("$");
            for (var j = 1;j < channel_array.length; j++) {
                var channelinfo=channel_array[j].split("|");
                channelist[channelist.length] = {"cameraid":channelinfo[1],"channelid":channelinfo[2],"name":channelinfo[3]};
            }
            $("#load_img").css("display","none");
        }
        function EYE_ChangePlayWindowStatus(hWnd,lStatus,lType){
            //$("#play_area").EYE2Player("GetPlayer").ChangePlayWindowStatus(hWnd,lStatus);
        }

        function EYE_HandlePtzControl(hWnd, lPTZCommand, sPuID, sChannelID){
            document.getElementById("EYEPlayer").PTZControlEx(hWnd,lPTZCommand,5);
        }

        //海康萤石云回调加载
        function HIKYSY_NotifyChannelMessage(){
//解析配置Site
            // hikysy://name:psd/[2088:园区大门,2089:大棚一号]
            var s = videosite.substr(videosite.indexOf('://')+3).split('/');
            var name =s[0].split(":")[0];
            var psd  =s[0].split(":")[1];
            var chan =s[1];
            $("#load_img").css("display","block");
            jQuery.ajax({
                type : "post",
                data:{
                    name:name,
                    psd:psd
                },
                url : "video/getYS",
                cache:false,
                success : function(data) {
                    $("#load_img").css("display","none");
                    var data1=JSON.parse(data);
                    if(data1.error){
                        alert(data1.error)
                        return false;
                    }else{
                        //设置视频对象的值
                        $("#play_area").HIKYSYPlayer('InitServiceInfo',data1);

                        //请求后，通道列表操作
                        chan=chan.replace("[","").replace("]","").split(",");
                        var serial=""
                        for(var i=0 ;i<chan.length;i++){
                            var infos =chan[i].split(":");
                            if(i==0){
                                serial= infos[0] ;
                            }
                        }

                        if(chan.length>0){//加载第一路视频
                            setTimeout(function(){
                                if(serial!=""){
                                    PlayVideo(serial,0)
                                }
                            },200)
                        }
                    }
                }
            });
        }
        /**
         * 事件提醒
         */
        function EventNotify(event_type, wnd_index, xml) {
            var info ={
                event_type:event_type
                ,xml:xml
            }
            $("#play_area").HIK9800Player('EventHandler',info)
        }

        function parseVideoSite(){
            var s = videosite.substr(videosite.indexOf('://')+3).split(';');
            var dev_id =s[3].split("/")[0];
            var chan =s[3].split("/")[1];
            chan=chan.replace("[","").replace("]","").split(",");
            for(var i=0 ;i<chan.length;i++){
                var infos =chan[i].split(":");
                eye_channels[eye_channels.length]={name:infos[1],cameraid:dev_id,channelid:infos[0]};
            }
        }
    </script>

    <style type="text/css">
        /* 企业简介  的弹出框样式  */
        .black_overlay{
            display: none;
            position: absolute;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 100%;
            /*background-color: black; */
            z-index:1001;
            -moz-opacity: 0.8;
            opacity:.80;
            filter: alpha(opacity=88);
        }
        .white_content {
            display: none;
            position: absolute;
            top: 125px;
            right: 1%;
            /*width: 25%;
            height: 60%; */
            width: 355px;
            height: 450px;
            padding: 5px;
            /*border: 1px solid #093800; */
            background-color: rgb(196, 240, 188);
            z-index:1002;
            overflow: auto;
        }

        /* 百度地图 右侧合计DIV */
        .scope{ width:280px; background:url(http://114.215.249.168:8080/IOT/new_page_files/map/images/scope_bg.png) no-repeat; font-family:"微软雅黑", "微软繁黑体"; font-size:20px; padding:10px 10px; line-height:36px;padding-left:38px;}
        .scope table td{ width:110px; color:#166893; background:url(http://114.215.249.168:8080/IOT/new_page_files/map/images/cricle.png) 0px 18px no-repeat; padding-left:14px;}
        .scope table th{color:#166893;}


        /* 百度地图 右侧企业查询DIV */
        .data-list th, .data-list td {
            padding: 0;
            width: auto;
            border-right: 1px solid #fff;
            border-bottom: 1px solid #fff;
            text-align: left;
            font-weight: normal;
            height: 28px;
        }

        .data-list th {
            height: 28px;
            line-height: 16px;
            color: #000;
            vertical-align: middle;
            background-color: #acacac;
            background: url(http://114.215.249.168:8080/IOT/image/table_title.png) repeat-x;
            padding-left: 1.6%;
            width: 15%;
            text-align: center;
        }


        .data-list td {
            padding: 6px;
            font-size:16px;
            font-family: Tahoma;
            background-color: #EBF8FF;
            border-bottom: 1px solid #fff;
            padding: 2px 0 2px 1.6%;
            vertical-align: middle;
            width: 15%;
            text-align: center;
        }

        #allmap label{
            max-width:none;
        }


    </style>

</head>

<body >

<div id="show_vedio">
    <div style="text-align:right;"><span onclick="showCurVedio()" style="cursor:pointer;width:100%;height:100%;margin-top:3px;margin-right:3px;font-weight:bold">X</span></div>
    <!--  <div  id="load_img" style="position: absolute;z-index: 100000000;top:30%;left:40%;" ><img src="http://114.215.249.168:8080/IOT/new_page_files/Bloading.gif"  /></div> -->
    <div id="play_area" align="center" style="z-index:19810823"></div>
</div>
<div id="pack_echart">
    <div id="count_div" style="width:400px;height:240px;position:absolute;right:40px;bottom:40px;z-index:400;"></div>
</div>
<div class="xq" id="project_div">
    <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/jian.png"  /><div class="tt" id="project_title"></div>

    <div id="company_show" class=" nr nr1" style="position:absolute;">
        <div class="js pull-right" style="width:245px" id="project_content">


        </div>
        <div style="width:217px">
            <div id="project_smart" style="width:217px;height:170px">


            </div>
            <div id="project_video">

            </div>
        </div>
    </div>
</div>

<input type="hidden" id="loginUserName" value="888888" />
<input id="apptitle" type="text" value="牧中智慧畜牧业云平台GIS（地理）系统" style="display: none;" >
<input id="regionName" value="浙江省" style="display: none;">
<form id="index" name="fmMap" action="/IOT/map/index.action" method="post">
    <input type="hidden" name="argstypejs" value="[{&quot;mct_id&quot;:&quot;9429FE8E-D236-4EF2-92A8-E51383974A82&quot;,&quot;mct_name&quot;:&quot;养殖场&quot;,&quot;parent_id&quot;:&quot;0&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_handler&quot;,&quot;mct_id&quot;:&quot;3E677858-6267-461B-B9FC-B617BDCF50AB&quot;,&quot;mct_logo_url&quot;:&quot;harmless&quot;,&quot;mct_name&quot;:&quot;无害化处理厂&quot;,&quot;parent_id&quot;:&quot;0&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_slaughter&quot;,&quot;mct_id&quot;:&quot;227EBC58-52EF-42A8-8ADF-CEA3016859F1&quot;,&quot;mct_logo_url&quot;:&quot;slaughter&quot;,&quot;mct_name&quot;:&quot;屠宰场&quot;,&quot;parent_id&quot;:&quot;0&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_drug&quot;,&quot;mct_id&quot;:&quot;CBA8D30D-F4B6-4F77-81DE-7417B6501127&quot;,&quot;mct_logo_url&quot;:&quot;drug_sale&quot;,&quot;mct_name&quot;:&quot;兽药生产企业&quot;,&quot;parent_id&quot;:&quot;0&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_forage&quot;,&quot;mct_id&quot;:&quot;99DBEA3A-FF9E-4E08-9B71-D354349FA0A3&quot;,&quot;mct_logo_url&quot;:&quot;forage_produce&quot;,&quot;mct_name&quot;:&quot;饲料生产企业&quot;,&quot;parent_id&quot;:&quot;0&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_supervision&quot;,&quot;mct_id&quot;:&quot;31A2E63A-9F3B-4097-8675-0AAD14631ECB&quot;,&quot;mct_logo_url&quot;:&quot;health&quot;,&quot;mct_name&quot;:&quot;动物卫生监督检查站&quot;,&quot;parent_id&quot;:&quot;0&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_breed.breed_type&quot;,&quot;mct_id&quot;:&quot;AF2ADA83-10C9-4292-8510-8DCC98AB5B6D&quot;,&quot;mct_logo_url&quot;:&quot;pig&quot;,&quot;mct_name&quot;:&quot;猪&quot;,&quot;parent_id&quot;:&quot;9429fe8e-d236-4ef2-92a8-e51383974a82&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_breed.breed_type&quot;,&quot;mct_id&quot;:&quot;1BF6223D-89AE-43B7-9893-A2ECDE6FA842&quot;,&quot;mct_logo_url&quot;:&quot;cow&quot;,&quot;mct_name&quot;:&quot;肉牛&quot;,&quot;parent_id&quot;:&quot;9429fe8e-d236-4ef2-92a8-e51383974a82&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_breed.breed_type&quot;,&quot;mct_id&quot;:&quot;BC514169-BA44-481F-B8F1-8B5C320D4B10&quot;,&quot;mct_logo_url&quot;:&quot;cow&quot;,&quot;mct_name&quot;:&quot;奶牛&quot;,&quot;parent_id&quot;:&quot;9429fe8e-d236-4ef2-92a8-e51383974a82&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_breed.breed_type&quot;,&quot;mct_id&quot;:&quot;945B41CB-F9E6-4D11-BE77-CF03EDD40C57&quot;,&quot;mct_logo_url&quot;:&quot;sheep&quot;,&quot;mct_name&quot;:&quot;羊&quot;,&quot;parent_id&quot;:&quot;9429fe8e-d236-4ef2-92a8-e51383974a82&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_breed.breed_type&quot;,&quot;mct_id&quot;:&quot;226BA6B0-628C-4774-812A-F95053731F21&quot;,&quot;mct_logo_url&quot;:&quot;rabbit&quot;,&quot;mct_name&quot;:&quot;兔&quot;,&quot;parent_id&quot;:&quot;9429fe8e-d236-4ef2-92a8-e51383974a82&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_breed.breed_type&quot;,&quot;mct_id&quot;:&quot;FB2FD3FC-6022-4AE9-BE7A-EA2B32D8A0E4&quot;,&quot;mct_logo_url&quot;:&quot;chicken&quot;,&quot;mct_name&quot;:&quot;鸡&quot;,&quot;parent_id&quot;:&quot;9429fe8e-d236-4ef2-92a8-e51383974a82&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_breed.breed_type&quot;,&quot;mct_id&quot;:&quot;299BEAB1-C408-42B7-BB1E-CB8F7EF6FAE6&quot;,&quot;mct_logo_url&quot;:&quot;duck&quot;,&quot;mct_name&quot;:&quot;鸭&quot;,&quot;parent_id&quot;:&quot;9429fe8e-d236-4ef2-92a8-e51383974a82&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_breed.breed_type&quot;,&quot;mct_id&quot;:&quot;6E0763CC-71AD-46A7-B111-C1284CD84744&quot;,&quot;mct_logo_url&quot;:&quot;goose&quot;,&quot;mct_name&quot;:&quot;鹅&quot;,&quot;parent_id&quot;:&quot;9429fe8e-d236-4ef2-92a8-e51383974a82&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;data_relation&quot;:&quot;view_company_breed.breed_type&quot;,&quot;mct_id&quot;:&quot;3D32478D-0379-41E7-89FA-68636205A819&quot;,&quot;mct_logo_url&quot;:&quot;bee&quot;,&quot;mct_name&quot;:&quot;蜂&quot;,&quot;parent_id&quot;:&quot;9429fe8e-d236-4ef2-92a8-e51383974a82&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;mct_id&quot;:&quot;2BA4B0F9-4BD6-4A5E-B0A6-0A61CBF46365&quot;,&quot;mct_logo_url&quot;:&quot;drug_produce&quot;,&quot;mct_name&quot;:&quot;生产企业&quot;,&quot;parent_id&quot;:&quot;cba8d30d-f4b6-4f77-81de-7417b6501127&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true},{&quot;mct_id&quot;:&quot;D5B578D7-6755-4775-A254-4370E9901488&quot;,&quot;mct_logo_url&quot;:&quot;drug_sale&quot;,&quot;mct_name&quot;:&quot;经营企业&quot;,&quot;parent_id&quot;:&quot;cba8d30d-f4b6-4f77-81de-7417b6501127&quot;,&quot;retcode&quot;:0,&quot;success&quot;:true}]" id="argstypejs"/>
    <input type="hidden" name="munitsjs" value="null" id="munitsjs"/>

    <!-- @@@@@@@@@@@@@@@@@@@@@@@  Top start  @@@@@@@@@@@@@@@@@@@@@@@ -->

    <nav class="nav top-bg "  role="navigation" >
        <div class="container-fluid  " style ="z-index:130">
      <div style="height:70px;margin-top:7px;">牧中智慧畜牧业云平台GIS（地理）系统</div>



            <div class="dh">
                <ul style="float: right;margin-right: 15px;" >

                    <li style="width:132px;height:60px;margin-top:17px;" class="tabon"><a href="javascript:void(0)" class="tabon"><img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/Flag.png"/><p>示范应用</p></a></li>


                    <li style="width:132px;height:60px;margin-top:17px;" ><a href="video/index"><img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/tv.png"/><p>监控总览</p></a></li>


                    <li><img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/shu.png"/></li>
                    <li style="margin-left:20px;margin-top:17px;" ><a href="user/logout"><img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/logout.png"/><p>退出系统</p></a></li>
                </ul>

            </div>

        </div>
        <div class="buchong" style="display:block;margin-top:0px;z-index:30;">
            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/earth2.png" class="icon1" title="卫星" onclick="switchMap()"/>
            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/fangda.png" class="icon2" title="放大" onclick="changeZoom('plus')"/>
            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/suoxiao.png" class="icon3" title="缩小" onclick="changeZoom()"/>
            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/earth.png" class="icon4" title="地图" onclick="switchMap('normal')"/>
        </div>
    </nav>
    <div class="searchmask" id="load_img">
        <div class="spinner">
            <div class="rect1"></div>
            <div class="rect2"></div>
            <div class="rect3"></div>
            <div class="rect4"></div>
            <div class="rect5"></div>
        </div>
    </div>
    <!-- @@@@@@@@@@@@@@@@@@@@@@@  Top end  @@@@@@@@@@@@@@@@@@@@@@@ -->

    <div id="left_panel"style="width:300px;position:absolute;top:77px;background:rgba(255,255,255,.7);filter: progid:DXImageTransform.Microsoft.Gradient(startColorstr=#99ffffff,endColorstr=#99ffffff);z-index:200;">
        <div style="padding:0;width:300px;">
            <div class="leftsidebar_box">

                <dl class="system_log">
                    <dt><img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/back.png">行政区域</dt>
                    <dd class="first_dd" style="border-bottom:1px solid #666;"><span class="activespan zjs" id="topRegion"></span><p id="subRegions"></p></dd>
                    <dd id="endRegions"></dd>
                </dl>

                <dl class="custom">
                    <dt><img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/back.png"/>选择类型</dt>
                    <dd class="first_dd" style="height:180px;overflow-y:scroll;position:relative;">


                        <div class="block1" tname="无害化处理厂">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri01.png"><p style="padding-left:2px">无害化处理厂</p>
                        </div>



                        <div class="block1" tname="屠宰场">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri02.png"><p>屠宰场</p>
                        </div>



                        <div class="block1" tname="动物卫生监督检查站">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri03.png"><p>动物卫生监督检查站</p>
                        </div>



                        <div class="block1" tname="兽药生产企业">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri14.png"><p>兽药生产企业</p>
                        </div>



                        <div class="block1" tname="饲料生产企业">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri13.png"><p>饲料生产企业</p>
                        </div>



                        <div class="block1" tname="猪">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri04.png"><p>猪</p>
                        </div>
                        <div class="block1" tname="肉牛">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri05.png"><p>肉牛</p>
                        </div>
                        <div class="block1" tname="奶牛">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri06.png"><p>奶牛</p>
                        </div>
                        <div class="block1" tname="羊">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri07.png"><p>羊</p>
                        </div>
                        <div class="block1" tname="兔">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri08.png"><p>兔</p>
                        </div>
                        <div class="block1" tname="鸡">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri09.png"><p>鸡</p>
                        </div>
                        <div class="block1" tname="鸭">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri10.png"><p>鸭</p>
                        </div>
                        <div class="block1" tname="鹅">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri11.png"><p>鹅</p>
                        </div>
                        <div class="block1" tname="蜂">
                            <img src="http://114.215.249.168:8080/IOT/new_page_files/map/images/cri12.png"><p>蜂</p>
                        </div>

                    </dd>
                </dl>


            </div>
        </div>

    </div>


    <!-- <div class="right" style="margin-top:0px; margin-left:202px; position:relative;">  -->
    <div id="map_area_div_id" style="margin-left:0px; position:relative; ">

        <div class="popwinright" id="popwinright" style="display: block; width:30px; height:70%; background-color:#ff000000; border :0px solid Silver;">
            <div id="treeboxbox_type_right" style="display: none; width:304px; margin-top:-43px;height:100%; float: right; background-color:#eeeeee;border :1px solid Silver;  ">

                <div class="searchbg">
                    <div class="search-block" >
                        <input type="hidden" value=""  id="inform_region"/>
                        <input type="text" value=""  id="inform_searchvalue" class="form-control search "><input onclick="_firstPage('inform');" type="button" class="btn_bg">
                    </div>
                </div>

                <div id="tabgrid" style="width:304px; height:395px; overflow-y:auto; background-color:#f5f5f5;border :1px solid #c6c6c6;">
                    <table id="inform_tr"   class="table table-striped newtable">
                        <thead style="background:#59a9d6; font-size:16px; color:#fff;">
                        <tr>
                            <th style="text-align:center;">企业名称</th>
                        </tr>
                        </thead>

                    </table>
                    <div class="text-center hy" id="inform_pager">
                    </div>
                </div>
            </div>
            <div id="treetabgridhideshow" onClick="javascript: treeTypeShowRight(treeboxbox_type_right, treetabgridhideshow, popwinright);" style="width:30px; height:auto; float: right; border :0px solid Silver; position:absolute; right:0px; z-index:1001; cursor:pointer;margin-top:78px;">
                <img id="treetabgridhideshowdivimg" src="http://114.215.249.168:8080/IOT/new_page_files/map/images/search1.png"/>
            </div>
        </div>





        <div  id="allmap" style="width: 100%; height: 100%; background-color : #000000; overflow: hidden;margin:0;">
        </div>
        <!-- 线路规划 -->
        <div id="serch_line" style="display: none;width: 100%; height: 100%; z-index:1000000000000">
            <div  id="allmap2" style="width: 100%; height: 100%; background-color : #000000; overflow: hidden;margin:0;">
            </div>

            <div id="left-panel" class="" style="height: 315px;">
                <div id="searchbox" class="clearfix">
                    <div id="searchbox-container">
                        <div id="sole-searchbox-content" class="searchbox-content" style="display: none;">
                            <input id="sole-input" class="searchbox-content-common" type="text" name="word" autocomplete="off" maxlength="256" placeholder="搜地点、查公交、找路线" value="">
                            <div class="input-clear" title="清空" style="display: none;"></div>
                            <div class="searchbox-content-button right-button route-button loading-button" data-title="路线" data-tooltip="1">
                            </div>
                        </div>
                        <div id="route-searchbox-content" class="searchbox-content route-searchbox-content drive" style="display: block;">
                            <div class="route-header">
                                <div class="searchbox-content-common route-tabs">
                                    <div class="tab-item bus-tab" data-index="bus" onclick="changeMode(this)">
                                        <i></i>
                                        <span>公交</span>
                                    </div>
                                    <div class="tab-item drive-tab" data-index="drive" onclick="changeMode(this)">
                                        <i></i>
                                        <span>驾车</span>
                                    </div>
                                    <div class="tab-item walk-tab" data-index="walk" onclick="changeMode(this)">
                                        <i></i>
                                        <span>步行</span>
                                    </div>

                                    <div class="tab-item bike-tab" data-index="bike" onclick="changeMode(this)">
                                        <i></i><span>骑行</span>
                                    </div>

                                    <div class="arrow-wrap"></div>
                                </div>
                                <div class="searchbox-content-button right-button cancel-button loading-button" title="关闭路线" onclick="hideSercherLine();" data-tooltip="2">
                                </div>    </div>    <div class="routebox">        <div class="searchbox-content-common routebox-content">
                            <div class="routebox-revert" title="切换起终点">
                                <div class="routebox-revert-icon" onclick="exchange()">
                                </div>
                            </div>
                            <div class="routebox-inputs">
                                <div class="routebox-input route-start">
                                    <div class="route-input-icon">
                                    </div>
                                    <input autocomplete="off" maxlength="256" placeholder="输入起点或在图区上选点" class="route-start-input" type="text" readonly="true" value="">

                                    <!--  <div class="input-clear" title="清空" style="display: block;" onclick='clearInput("route-start-input")'>
                                    </div>-->

                                </div>
                                <div class="routebox-input route-end">
                                    <div class="route-input-icon">
                                    </div>
                                    <input autocomplete="off" maxlength="256" placeholder="输入终点或在图区上选点" class="route-end-input" type="text" readonly="true" value="">
                                    <!--<div class="input-clear" title="清空" style="display: block;" onclick='clearInput("route-end-input")'>
                                    </div> -->
                                </div>
                            </div>
                        </div>
                        </div></div></div>
                    <div id="search-button" title="搜索" data-tooltip="3" onclick="planLine();"></div>
                </div>
            </div>

            <div id="results"  style="position:absolute;top:230px;left:20px;width:370px;display:none; height:60%; background-color : #fff; overflow: scroll;margin:0;">
            </div>
        </div>


        <div id="fade" class="black_overlay"></div>

    </div>



</form>



<input id="base" value="http://114.215.249.168:8080/IOT/" style="display: none;">
<script type="text/javascript" >

    initMap();

    initMap2();
    var XUMU_URL ="http://114.215.249.167/zjtrace";
    var regionName=$("#regionName").val();
    var titles=$("#titles");
    titles.html(regionName+"农业物联网服务平台");
    var base=basePath;		//转给视频跳转页面用的
    var thisRegions;
    var topRegion ,selectedRegion;//最顶部的行政单位


    //所有产业类型默认为全部选中
    var argstypejs = eval(fmMap.argstypejs.value);

    var showArgTypeTabIds = new ArrayList();
    for(var i = 0;i < argstypejs.length; i++){
        var argstype = argstypejs[i];
        //showArgTypeTabIds.add(argstype.mct_id);

        //装载各产业类型的id
        $(".block1").each(function (){
            if($(this).attr("tname")==argstype.mct_name){
                $(this).attr("id",argstype.mct_id);
            }
        })
    }

    //2017/02/07 添加了权限功能，只加载页面上显示出来的Button的ID
    $(".block1").each(function(){
        var id = $(this).attr('id');
        showArgTypeTabIds.add(id);
    });
    console.info(showArgTypeTabIds);


    var hk8800_jsons = [];
    var videosite ="";

    //转换协议
    function parseVedioUrl(selectID2){
        $.ajax({
            type:"post",
            url:"video/getEntityByMunitsId",
            data:"munitsId="+selectID2+"&delPlaceMenu=yes",
            cache:false,
            success:function(msg){
                if(msg=="" || msg==null || msg=="[]"){return;}
                var list=msg.split("/&");
                showCurVedio(list[2])
            }
        })
    }


    //显示视频
    function  showCurVedio(vs){
        if(vs){
            $("#load_img").css("display","block");
            $("#show_vedio").css("display","block");
            videosite =vs;
            var video_width = $("#show_vedio").width()-10;
            var video_height = $("#show_vedio").height()-20;
            $("#load_img").css("display","block");
            if(videosite.indexOf("hik8800://")>-1){
                $("#play_area").HIK8800Player({
                    "width":video_width,
                    "height":video_height,
                    "videosite":videosite
                }).hide();
                if($("#play_area object").size()<1){
                    $("#play_area").show();
                    $("#load_img").css("display","none");
                }else{
                    showHIK8800Channel();
                }
            }else if(videosite.indexOf("hik9800://")>-1){
                //hik9800://admin:admin@ip:80/[0:通道1,1:通道2,2:通道3]
                $("#play_area").HIK9800Player({
                    "width":video_width,
                    "height":video_height,
                    "videosite":videosite,
                    "LoadedCallback":DAHUAP2P_NotifyChannelMessage
                }).hide();
                if($("#play_area object").size()<1){$("#play_area").show();}
            }else if(videosite.indexOf("hik8200://")>-1){
                $("#play_area").HIK8200Player({
                    "width":video_width,
                    "height":video_height,
                    "videosite":videosite,
                    "LoadedCallback":DAHUAP2P_NotifyChannelMessage
                }).hide();
                if($("#play_area object").size()<1){$("#play_area").show();}
            } else if(videosite.indexOf("hikysy://")>-1){
                $("#play_area").HIKYSYPlayer({
                    "width":video_width,
                    "height":video_height,
                    "videosite":videosite,
                    "LoadedCallback":HIKYSY_NotifyChannelMessage
                }).hide();
                //如果未安装控件
                if($("#play_area object").size()<1){$("#play_area").show();}
            }
            /*
             else if(videosite.indexOf("hikweb://")>-1){
             //Add by Tsd
             $("#play_area").HIKWEBPlayer({
             "width":video_width,
             "height":video_height,
             "videosite":videosite,
             "LoadedCallback":DAHUAP2P_NotifyChannelMessage
             }).hide();

             $("#play_area").HIKWEBPlayer('SetScreenNum',1);

             //如果未安装控件
             if($("#play_area object").size()<1){$("#play_area").show();}
             }
             */
            else if(videosite.indexOf("eye2://")>-1){
                $("#load_img").css("display","none");
                $("#play_area").EYE2Player({
                    "width":video_width,
                    "height":video_height,
                    "videosite":videosite
                }).hide();
                if($("#play_area object").size()<1){$("#play_area").show();}else{;}
            }else if(videosite.indexOf("dhdss://")>-1){
                //videosite格式： dahua://user:pass@ip:port
                $("#load_img").css("display","block");
                $("#play_area").DHDSSPlayer({
                    "width":video_width,
                    "height":video_height,
                    "videosite":videosite,
                    "LoadedCallback":DAHUADSS_NotifyChannelMessage
                }).hide();
                //如果未安装控件
                if($("#play_area object").size()<1){$("#play_area").show();}
            }else if(videosite.indexOf("dhp2p://")>-1){
                //Add by Tsd
                //dahua2://user:pass@PZA4MF193WSI0KW/[1:门口,3:大棚1]
                $("#load_img").css("display","block");
                $("#play_area").DHP2PPlayer({
                    "width":video_width,
                    "height":video_height,
                    "videosite":videosite,
                    "LoadedCallback":DAHUAP2P_NotifyChannelMessage
                }).hide();
                //如果未安装控件
                if($("#play_area object").size()<1){$("#play_area").show();}
            }else if(videosite.indexOf("dhweb://")>-1){
                //Add by Tsd
                //dhweb://admin:admin@ip:38888/[0:通道1,1:通道2,2:通道3]
                //$("#load_img").css("display","block");
                $("#play_area").DHWEBPlayer({
                    "width":video_width,
                    "height":video_height,
                    "videosite":videosite,
                    "LoadedCallback":DAHUAP2P_NotifyChannelMessage
                })
            }
        }else{
            $("#play_area").HIK8800Player('DESTROY');
            $("#play_area").HIK9800Player('DESTROY');
            $("#play_area").HIK8200Player("DESTROY"); // 销毁"8200海康视频"
            $("#play_area").DHDSSPlayer("DESTROY"); //隐藏“大华视频”
            $("#play_area").HIKYSYPlayer("DESTROY"); // 销毁"海康YS"
            //$("#play_area").HIKWEBPlayer("DESTROY");//隐藏“海康WEB3.0视频”
            $("#play_area").EYE2Player('DESTROY');
            $("#play_area").DHP2PPlayer("DESTROY"); //隐藏“P2P大华视频”
            $("#play_area").DHWEBPlayer("DESTROY"); //隐藏“大华WEB3.0视频”
            $("#show_vedio").css("display","none");
        }
    }

    function showHIK8800Channel(){
        hk8800_jsons = [];
        var video_param_str = videosite.replace('hik8800://', '');

        var SrvIp = "";
        var PagIP = "",DeviceIp="",DevicePort="8000";
        var psd="",user="";
        var PROT ="";
        //hik8800://115.239.134.121:554:172.30.0.109/meirenzi002/[16:园区大门,17:设施通览,18:观光园区]
        //***老协议改***hik8800://115.239.134.121:554/ehome/172.30.0.109/meirenzi002/[16:园区大门,17:设施通览,18:观光园区]
        //***新增协议***hik8800://115.239.134.121:554/hiksdk/122.227.97.182:8000/admin@123456/[16:园区大门,17:设施通览,18:观光园区]
        //取出五个参数
        var parms_list =video_param_str.split("/");
        var server_info = parms_list[0],prot_info =parms_list[1],deviceORpag= parms_list[2],codeORlogin =parms_list[3] ,channelList =parms_list[4];
        channelList =channelList.replace("[","").replace("]","");
        var channel_array = channelList.split(',');
        PROT=prot_info;
        if(server_info.split(":").length==2){
            SrvIp =server_info;
        }else{
            SrvIp =server_info+":554";
        }
        if(prot_info=="ehome"){//ehome协议方式解析
            PagIP= deviceORpag;
            user = codeORlogin;
            for(var m=0;m<channel_array.length;m++){
                var this_channel = channel_array[m].split(':');
                var this_channel_json;
                //PROT:新增参数用来识别哪一个协议
                this_channel_json = {'PROT':PROT,'ChannelNum':this_channel[0],'CameraID':this_channel[1], 'CameraName':this_channel[2], 'SrvIp':SrvIp, 'PagIP':PagIP, 'CameraIndexCode':user};
                hk8800_jsons.push(this_channel_json);
            }
        }else{//hiksdk协议方式解析
            var devices =deviceORpag.split(":");
            var logins  =codeORlogin.split("@");
            if(devices.length==2){
                DeviceIp =devices[0];
                DevicePort =devices[1];
            }else{
                DeviceIp=deviceORpag;
            }
            user =logins[0];
            psd  =logins[1];
            for(var m=0;m<channel_array.length;m++){
                var this_channel = channel_array[m].split(':');
                var this_channel_json;
                //PROT:新增参数用来识别哪一个协议
                this_channel_json = {'PROT':PROT,'ChannelNum':this_channel[0],'CameraID':this_channel[1], 'CameraName':this_channel[2], 'SrvIp':SrvIp, 'DeviceIp':DeviceIp, 'DevicePort':DevicePort,'user':user,'psd':psd};
                hk8800_jsons.push(this_channel_json);
            }
        }
        //保持不变
        for(var i=0;i<channel_array.length;i++){
            var this_channel_obj = channel_array[i].split(':');
            var node_name = '通道'+(i+1);
            if(this_channel_obj.length>1 && this_channel_obj[2]!=''){
                node_name = this_channel_obj[2];
            }

        }
        if(channel_array[0]){
            setTimeout(function (){
                PlayVideo(channel_array[0],0);
            },600)
        }
    }

    function PlayVideo(channelinfo,idx){
        if(videosite.indexOf("hik8800://")>-1){
            var CameraID = hk8800_jsons[idx].CameraID;
            var ChannelNum = hk8800_jsons[idx].ChannelNum;
            var SrvIp = hk8800_jsons[idx].SrvIp;
            var PagIP = hk8800_jsons[idx].PagIP;
            var CameraIndexCode = hk8800_jsons[idx].CameraIndexCode;
            //======================新协议参数==========================
            var PROT = hk8800_jsons[idx].PROT;
            var CameraName = hk8800_jsons[idx].CameraName;
            var DeviceIp = hk8800_jsons[idx].DeviceIp;
            var DevicePort = hk8800_jsons[idx].DevicePort;
            var user = hk8800_jsons[idx].user;
            var psd = hk8800_jsons[idx].psd;
            //======================END=================================
            var xml_str=""
            if(PROT=="ehome"){
                xml_str ='<?xml version="1.0"?><Parament><CameraID>'+CameraID+'</CameraID><DevicePort>7402</DevicePort>'+
                    '<DeviceType>60001</DeviceType><ChannelNum>'+ChannelNum+'</ChannelNum><ProtocolType>0</ProtocolType>'+
                    '<StreamType>0</StreamType><Transmits><Transmit><SrvIp>'+SrvIp+'</SrvIp></Transmit></Transmits>'+
                    '<CameraIndexCode>'+CameraIndexCode+'</CameraIndexCode><PagIP>'+PagIP+'</PagIP></Parament>';
            }else{
                xml_str ='<?xml version="1.0"?><Parament><CameraID>'+CameraID+'</CameraID><CameraName>'+CameraName+'</CameraName><DeviceIP>'+DeviceIp+'</DeviceIP><DevicePort>'+DevicePort+'</DevicePort>'+
                    '<User>'+user+'</User><Password>'+psd+'</Password><ChannelNum>'+ChannelNum+'</ChannelNum>'+
                    //  '<Transmits><Transmit><SrvIp>'+SrvIp+'</SrvIp><Port>0</Port></Transmit></Transmits>'+
                    '<PagIP>'+DeviceIp+'</PagIP><PagPort>7071</PagPort></Parament>';
            }
            $("#play_area").show(); //.HIK8800Player('CLOSE');
            $("#play_area").HIK8800Player('PlayDevice',xml_str, 0);
        }else if(videosite.indexOf("hik9800://")>-1){
            var deviceinfo =   channelinfo.channelid;
            $("#play_area").show();
            return ($("#play_area").HIK9800Player('PlayDevice',deviceinfo));
        }else if(videosite.indexOf("hik8200://")>-1){
            var deviceinfo =   channelinfo.channelid;
            $("#play_area").show();
            return ($("#play_area").HIK8200Player('PlayDevice',deviceinfo));
        }else if(videosite.indexOf("hikysy://")>-1){
            $("#play_area").show();
            $("#play_area").HIKYSYPlayer('PlayDevice',channelinfo);
        }
        /*
         else if(videosite.indexOf("hikweb://")>-1){

         //Add by Tsd
         $("#play_area").show();
         $("#play_area").HIKWEBPlayer('PlayDevice',channelinfo.channelid, 0);
         }
         */
        else if(videosite.indexOf("eye2://")>-1){
            var deviceinfo = {
                "cameraid": channelinfo.cameraid,
                "name": channelinfo.name,
                "channelid": channelinfo.channelid
            };
            $("#play_area").show().EYE2Player('CLOSE');
            $("#play_area").EYE2Player('PlayDevice',deviceinfo);
        }else if(videosite.indexOf("dhdss://")>-1){
            $("#play_area").show();
            $("#play_area").DHDSSPlayer('PlayDevice',channelinfo);
        }else if(videosite.indexOf("dhp2p://")>-1){
            //Add by Tsd
            var deviceinfo = {
                "channelid":channelinfo.channelid
            };
            $("#play_area").show();
            $("#play_area").DHP2PPlayer('PlayDevice',deviceinfo, 0);
        }else if(videosite.indexOf("dhweb://")>-1){
            //Add by Tsd
            var deviceinfo = {
                "channelid":channelinfo.channelid
            };

            $("#play_area").show();
            $("#play_area").DHWEBPlayer('PlayDevice',deviceinfo, 0);
            $("#play_area").DHWEBPlayer("SetScreenNum",1);
        }
        $("#load_img").css("display","none");//at 20161122
    }

    $('div[id="u0"]').prepend('<div class="uo_txt">浙江省动物标识追溯监管GIS系统</div>');


</script>

<script>

    //组装城市功能
    function assemblyRegions(){
        var _top ={
            "grade":100
            ,"obj":null
        }
        for(var i =0; i<thisRegions.length;i++){
            if(Number(thisRegions[i].grade)<_top.grade){
                _top.grade =Number(thisRegions[i].grade);
                _top.obj =thisRegions[i];
            }
        }
        topRegion = _top.obj;
        $("#inform_region").val(topRegion.id);
        $("#topRegion").html(topRegion.name);

        var subs ="";
        for(var i =0; i<thisRegions.length;i++){
            if(thisRegions[i].parentid==topRegion.id){//第二级
                subs +="<span title='"+thisRegions[i].name+"' id='region"+thisRegions[i].id+"'>"+thisRegions[i].name+"</span>";
            }
        }
        $("#subRegions").html(subs);
    }
    //根据城市ID得到城市对象
    function getRegionNameById(id){
        for(var i =0; i<thisRegions.length;i++){
            if(thisRegions[i].id==id){
                return thisRegions[i];
            }
        }
    }

    //根据城市名得到城市对象 AT:2016-11-07
    function getRegionByName(name){
        for(var i =0; i<thisRegions.length;i++){
            if(thisRegions[i].name==name){
                return thisRegions[i];
            }
        }
    }


    //根据城市ID得到城市对象
    function getParentRegionNameById(id){
        var r =getRegionNameById(id);
        for(var i =0; i<thisRegions.length;i++){
            if(thisRegions[i].id==r.parentid){
                return thisRegions[i];
            }
        }
        return {name:"浙江省"}

    }

    //得到指定div下的选中的区域
    function getSelectRegion(id){
        return ($("#"+id+" [class='activespan']").attr("id").split("region")[1])
    }

    //切换地图类型
    function switchMap(flag){
        if(flag=="normal"){
            mapView.setMapType(BMAP_NORMAL_MAP);
        }else{
            mapView.setMapType(BMAP_HYBRID_MAP);
        }
    }

    //放缩地图Zoom
    function changeZoom(status){
        if(status=="plus"){//+
            mapView.setZoom(mapView.getZoom() + 1);
        }else{//-
            mapView.setZoom(mapView.getZoom() - 1);
        }
    }

    //处理地图上点击合计或点击具体企业后，左侧行政区域界面的处理
    function mapSelectRegionHandler(id){
        var r =getRegionNameById(id);
        if(r.grade=="2"){
            $("#region"+id).trigger("click");
        }else if(r.grade=="3"){
            $("#endRegions").html("");
            var subs ="";
            for(var i =0; i<thisRegions.length;i++){
                if(thisRegions[i].parentid==r.parentid){//加第三级
                    subs +="<span title='"+thisRegions[i].name+"' id='region"+thisRegions[i].id+"'>"+((thisRegions[i].name && thisRegions[i].name.length>4)?(thisRegions[i].name.substr(0,3)+"..."):thisRegions[i].name)+"</span>"
                }
            }
            $("#endRegions").html(subs);

            $("#endRegions span").click(function(){
                $(this).parent().children().removeClass("activespan");
                $(this).addClass("activespan");
                selectedRegion =getRegionNameById($(this).attr("id").split("region")[1]);
                treeNodeCheckAndFocusOverlay(selectedRegion.id,true);
            });
            $("#region"+id).trigger("click");
        }

    }


    function WindowResizeEvent(){
        var window_height = $(document).height();
        $('#map_area_div_id').css('height',(window_height)+'px');
        $('#load_img').css('height',(window_height)+'px'); //at 20161122
        if($('#tabgrid').height()> window_height-165){
            $('#tabgrid').css('height',(window_height-165)+'px');
        }else{
            $('#tabgrid').css('height',($('#popwinright').height()-40)+'px');
        }
    }


    //请求后操作GRID
    function afterRequestHander(res_data){
        for(var i =0;i<res_data.length;i++){
            var grade =res_data[i].grade;
            var tname =res_data[i].tname;
            var id =res_data[i].id;
            var regionid =res_data[i].regionid;
            var rowString ="<tr>";
            rowString +="<td onclick='handlerShowCompany(\""+id+"\",\""+regionid+"\",\""+grade+"\",\""+tname+"\")' style='text-align:left;overflow:hidden;text-overflow:ellipsis;-o-text-overflow:ellipsis;white-space:nowrap;font-size:22px;text-indent:20px;'><a herf='javascript:void(0);' style='cursor:pointer;' title='"+res_data[i].name+"'>"+res_data[i].name+"</a></td>";
            rowString +="</tr>"
            insertRow("inform_tr",rowString);
        }

        var tablename=document.getElementById("inform_tr");
        var li=tablename.getElementsByTagName("tr");
        for (var i=1;i<li.length;i++){
            if(i%2 !=0){
                li[i].style.backgroundColor="#e2f2fc";
            }else{
                li[i].style.backgroundColor="#ffffff";
            }
        }
    }
    function handlerShowCompany(id,regionid,grade,tname){
        if(grade!=3){
            if(grade==4){ //如果设置为乡镇/街道，则默认为在上一级的区域内显示
                regionid =regionid.substr(0,6)+"000000";
            }else{
                alert("企业的行政区域未明确 ，请重新设置后再操作！");
                return false;
            }
        }

        //点击操作
        singleCompanyClick(id,regionid,tname);
        /*
         var imgName = "imgs/iot_agrtypeshadow";
         requestHandler.handler=function (){
         iconAnimation(imgName,new BMap.Point(Number(lng), Number(lat)));
         requestHandler.handler=function (){};
         }
         mapSelectRegionHandler(regionid);
         */
    }

    //处理右侧的点击相应企业的回调事务
    var  requestHandler ={
        handler:function (){

        }
    }


    $(document).keydown(function(event){
        if(event.keyCode == 13){ // 如果是“回车键”则提交
            _firstPage('inform');
        }
    });

    $(document).ready(function(){

        WindowResizeEvent();
        var width = document.body.clientWidth ;
        //$("#type_list").html('')
        var regionName=$("#regionName").val();
        eval('thisRegions=[{"grade":"1","id":"330000000000","name":"浙江省","parentid":"0"},{"grade":"2","id":"330100000000","name":"杭州市","parentid":"330000000000"},{"grade":"3","id":"330102000000","name":"上城区","parentid":"330100000000"},{"grade":"3","id":"330103000000","name":"下城区","parentid":"330100000000"},{"grade":"3","id":"330104000000","name":"江干区","parentid":"330100000000"},{"grade":"3","id":"330105000000","name":"拱墅区","parentid":"330100000000"},{"grade":"3","id":"330106000000","name":"西湖区","parentid":"330100000000"},{"grade":"3","id":"330108000000","name":"滨江区","parentid":"330100000000"},{"grade":"3","id":"330109000000","name":"萧山区","parentid":"330100000000"},{"grade":"3","id":"330110000000","name":"余杭区","parentid":"330100000000"},{"grade":"3","id":"330111000000","name":"富阳区","parentid":"330100000000"},{"grade":"3","id":"330122000000","name":"桐庐县","parentid":"330100000000"},{"grade":"3","id":"330127000000","name":"淳安县","parentid":"330100000000"},{"grade":"3","id":"330140000000","name":"大江东","parentid":"330100000000"},{"grade":"3","id":"330141000000","name":"下沙经济技术开发区","parentid":"330100000000"},{"grade":"3","id":"330182000000","name":"建德市","parentid":"330100000000"},{"grade":"3","id":"330185000000","name":"临安市","parentid":"330100000000"},{"grade":"2","id":"330200000000","name":"宁波市","parentid":"330000000000"},{"grade":"3","id":"330203000000","name":"海曙区","parentid":"330200000000"},{"grade":"3","id":"330204000000","name":"江东区","parentid":"330200000000"},{"grade":"3","id":"330205000000","name":"江北区","parentid":"330200000000"},{"grade":"3","id":"330206000000","name":"北仑区","parentid":"330200000000"},{"grade":"3","id":"330208000000","name":"高新区","parentid":"330200000000"},{"grade":"3","id":"330211000000","name":"镇海区","parentid":"330200000000"},{"grade":"3","id":"330212000000","name":"鄞州区","parentid":"330200000000"},{"grade":"3","id":"330225000000","name":"象山县","parentid":"330200000000"},{"grade":"3","id":"330226000000","name":"宁海县","parentid":"330200000000"},{"grade":"3","id":"330281000000","name":"余姚市","parentid":"330200000000"},{"grade":"3","id":"330282000000","name":"慈溪市","parentid":"330200000000"},{"grade":"3","id":"330283000000","name":"奉化市","parentid":"330200000000"},{"grade":"2","id":"330300000000","name":"温州市","parentid":"330000000000"},{"grade":"3","id":"330302000000","name":"鹿城区","parentid":"330300000000"},{"grade":"3","id":"330303000000","name":"龙湾区","parentid":"330300000000"},{"grade":"3","id":"330304000000","name":"瓯海区","parentid":"330300000000"},{"grade":"3","id":"330305000000","name":"洞头区","parentid":"330300000000"},{"grade":"3","id":"330306000000","name":"经济技术开发区","parentid":"330300000000"},{"grade":"3","id":"330324000000","name":"永嘉县","parentid":"330300000000"},{"grade":"3","id":"330326000000","name":"平阳县","parentid":"330300000000"},{"grade":"3","id":"330327000000","name":"苍南县","parentid":"330300000000"},{"grade":"3","id":"330328000000","name":"文成县","parentid":"330300000000"},{"grade":"3","id":"330329000000","name":"泰顺县","parentid":"330300000000"},{"grade":"3","id":"330381000000","name":"瑞安市","parentid":"330300000000"},{"grade":"3","id":"330382000000","name":"乐清市","parentid":"330300000000"},{"grade":"2","id":"330400000000","name":"嘉兴市","parentid":"330000000000"},{"grade":"3","id":"330402000000","name":"南湖区","parentid":"330400000000"},{"grade":"3","id":"330411000000","name":"秀洲区","parentid":"330400000000"},{"grade":"3","id":"330412000000","name":"开发区","parentid":"330400000000"},{"grade":"3","id":"330421000000","name":"嘉善县","parentid":"330400000000"},{"grade":"3","id":"330424000000","name":"海盐县","parentid":"330400000000"},{"grade":"3","id":"330481000000","name":"海宁市","parentid":"330400000000"},{"grade":"3","id":"330482000000","name":"平湖市","parentid":"330400000000"},{"grade":"3","id":"330483000000","name":"桐乡市","parentid":"330400000000"},{"grade":"2","id":"330500000000","name":"湖州市","parentid":"330000000000"},{"grade":"3","id":"330502000000","name":"吴兴区","parentid":"330500000000"},{"grade":"3","id":"330503000000","name":"南浔区","parentid":"330500000000"},{"grade":"3","id":"330521000000","name":"德清县","parentid":"330500000000"},{"grade":"3","id":"330522000000","name":"长兴县","parentid":"330500000000"},{"grade":"3","id":"330523000000","name":"安吉县","parentid":"330500000000"},{"grade":"3","id":"330524000000","name":"度假区","parentid":"330500000000"},{"grade":"3","id":"330525000000","name":"开发区","parentid":"330500000000"},{"grade":"2","id":"330600000000","name":"绍兴市","parentid":"330000000000"},{"grade":"3","id":"330602000000","name":"越城区","parentid":"330600000000"},{"grade":"3","id":"330603000000","name":"柯桥区","parentid":"330600000000"},{"grade":"3","id":"330604000000","name":"上虞区","parentid":"330600000000"},{"grade":"3","id":"330624000000","name":"新昌县","parentid":"330600000000"},{"grade":"3","id":"330681000000","name":"诸暨市","parentid":"330600000000"},{"grade":"3","id":"330683000000","name":"嵊州市","parentid":"330600000000"},{"grade":"2","id":"330700000000","name":"金华市","parentid":"330000000000"},{"grade":"3","id":"330701000000","name":"经济技术开发区","parentid":"330700000000"},{"grade":"3","id":"330702000000","name":"婺城区","parentid":"330700000000"},{"grade":"3","id":"330703000000","name":"金东区","parentid":"330700000000"},{"grade":"3","id":"330723000000","name":"武义县","parentid":"330700000000"},{"grade":"3","id":"330726000000","name":"浦江县","parentid":"330700000000"},{"grade":"3","id":"330727000000","name":"磐安县","parentid":"330700000000"},{"grade":"3","id":"330781000000","name":"兰溪市","parentid":"330700000000"},{"grade":"3","id":"330782000000","name":"义乌市","parentid":"330700000000"},{"grade":"3","id":"330783000000","name":"东阳市","parentid":"330700000000"},{"grade":"3","id":"330784000000","name":"永康市","parentid":"330700000000"},{"grade":"2","id":"330800000000","name":"衢州市","parentid":"330000000000"},{"grade":"3","id":"330802000000","name":"柯城区","parentid":"330800000000"},{"grade":"3","id":"330803000000","name":"衢江区","parentid":"330800000000"},{"grade":"3","id":"330822000000","name":"常山县","parentid":"330800000000"},{"grade":"3","id":"330824000000","name":"开化县","parentid":"330800000000"},{"grade":"3","id":"330825000000","name":"龙游县","parentid":"330800000000"},{"grade":"3","id":"330881000000","name":"江山市","parentid":"330800000000"},{"grade":"2","id":"330900000000","name":"舟山市","parentid":"330000000000"},{"grade":"3","id":"330902000000","name":"定海区","parentid":"330900000000"},{"grade":"3","id":"330903000000","name":"普陀区","parentid":"330900000000"},{"grade":"3","id":"330921000000","name":"岱山县","parentid":"330900000000"},{"grade":"3","id":"330922000000","name":"嵊泗县","parentid":"330900000000"},{"grade":"2","id":"331000000000","name":"台州市","parentid":"330000000000"},{"grade":"3","id":"331002000000","name":"椒江区","parentid":"331000000000"},{"grade":"3","id":"331003000000","name":"黄岩区","parentid":"331000000000"},{"grade":"3","id":"331004000000","name":"路桥区","parentid":"331000000000"},{"grade":"3","id":"331021000000","name":"玉环县","parentid":"331000000000"},{"grade":"3","id":"331022000000","name":"三门县","parentid":"331000000000"},{"grade":"3","id":"331023000000","name":"天台县","parentid":"331000000000"},{"grade":"3","id":"331024000000","name":"仙居县","parentid":"331000000000"},{"grade":"3","id":"331081000000","name":"温岭市","parentid":"331000000000"},{"grade":"3","id":"331082000000","name":"临海市","parentid":"331000000000"},{"grade":"2","id":"331100000000","name":"丽水市","parentid":"330000000000"},{"grade":"3","id":"331102000000","name":"莲都区","parentid":"331100000000"},{"grade":"3","id":"331121000000","name":"青田县","parentid":"331100000000"},{"grade":"3","id":"331122000000","name":"缙云县","parentid":"331100000000"},{"grade":"3","id":"331123000000","name":"遂昌县","parentid":"331100000000"},{"grade":"3","id":"331124000000","name":"松阳县","parentid":"331100000000"},{"grade":"3","id":"331125000000","name":"云和县","parentid":"331100000000"},{"grade":"3","id":"331126000000","name":"庆元县","parentid":"331100000000"},{"grade":"3","id":"331127000000","name":"景宁畲族自治县","parentid":"331100000000"},{"grade":"3","id":"331181000000","name":"龙泉市","parentid":"331100000000"}]');
        //加载行政区划
        assemblyRegions();
        //加载顶部行政区划
        selectedRegion =topRegion;
        treeNodeCheckAndFocusOverlay(selectedRegion.id,true);

        $(window).resize(function(){WindowResizeEvent();});
        $("#load_img").css("display","none");
        //初始化GIRD
        initPager({
            "inform":{
                current:1
                ,pageSize:13
                ,showPages:6
                ,total:0
                ,queryFields:{
                    "searchvalue":"type" //显示不用进行业务处理，取决于type的值，type缺省值string;
                    ,"region":"type"
                }
                ,url:base+"map/showAllCompany"//通用请求URL
                ,handler: afterRequestHander //请求返回后的处理方法
            }
        });

        //加载数据（过2秒钟执行）
        setTimeout(function(){
            flushPage('inform');
        },2000);
    });




    jQuery(function()  {

        $("a,button").focus(function(){this.blur()});
        //顶部导航切换


        //左侧菜单
        $(".leftsidebar_box dt").click(function(){
            $(this).parent().find('dd').removeClass("menu_chioce");

            if($(this).children("img").attr("src")=="http://114.215.249.168:8080/IOT/new_page_files/map/images/back2.png")
                $(this).children("img").attr("src","http://114.215.249.168:8080/IOT/new_page_files/map/images/back.png");
            else
                $(this).children("img").attr("src","http://114.215.249.168:8080/IOT/new_page_files/map/images/back2.png");

            $(this).parent().find('dd').slideToggle();
            $(this).parent().find('dd').addClass("menu_chioce");
        });

        //搜索缩放
        $(".ss").click(function(){
            var imgsrc=$(this).children("img").attr("src");
            if(imgsrc=="http://114.215.249.168:8080/IOT/new_page_files/map/images/arrow-l.png"){
                $(".sszk").css("display","block");
                $(this).css("display","none");
            }

        });

        $(".ss2").click(function(){
            var imgsrc=$(this).children("img").attr("src");
            if(imgsrc=="http://114.215.249.168:8080/IOT/new_page_files/map/images/qrrow-right.png"){
                $(".sszk").css("display","none");
                $(this).css("display","none");
                $(".ss").css("display","block");
            }

        });

        //选择区域
        $("#subRegions span").click(function(){
            $(".zjs").html("返回");
            $(this).parent().children().removeClass("activespan");
            $(this).addClass("activespan");
            if($(this).parent().attr("id")=="subRegions"){//如果是第二级的话需要显示对应区县
                $("#endRegions").html("");
                var subs ="";
                for(var i =0; i<thisRegions.length;i++){
                    if(thisRegions[i].parentid==($(this).attr("id").split("region")[1])){//加第三级
                        subs +="<span title='"+thisRegions[i].name+"' id='region"+thisRegions[i].id+"'>"+((thisRegions[i].name && thisRegions[i].name.length>4)?(thisRegions[i].name.substr(0,3)+"..."):thisRegions[i].name)+"</span>"
                    }
                }
                $("#endRegions").html(subs);
                //点击第二级的用户
                selectedRegion =getRegionNameById($(this).attr("id").split("region")[1]);
                treeNodeCheckAndFocusOverlay(selectedRegion.id,true);
                $("#endRegions span").click(function(){
                    $(this).parent().children().removeClass("activespan");
                    $(this).addClass("activespan");
                    selectedRegion =getRegionNameById($(this).attr("id").split("region")[1]);
                    treeNodeCheckAndFocusOverlay(selectedRegion.id,true);
                });
            }
        });




        $(".zjs").click(function(){
            $(this).html(topRegion.name);
            $(".system_log dd span").removeClass("activespan");
            $(this).addClass("activespan");
            selectedRegion =topRegion;
            $("#endRegions").html("");
            treeNodeCheckAndFocusOverlay(selectedRegion.id,true);
        });

        //选择类型
        $(".block1").click(function(){
            if($(this).children(".circleactive").attr("src")=="http://114.215.249.168:8080/IOT/new_page_files/map/images/cricle.png"){
                $(this).children(".circleactive").remove();
                $(this).attr("press","0")
            }else{
                $(this).children("img").before("<img src='http://114.215.249.168:8080/IOT/new_page_files/map/images/cricle.png' class='circleactive'>");
                $(this).attr("press","1")
            }
            addAreaTypeTabAndLoadData();

            if(current_area_grade==2 || current_area_grade==1){
                draw_map();
            }
        });

        //产业类型初始化都是选中的
        $(".block1").each(function (){
            $(this).children("img").before("<img src='http://114.215.249.168:8080/IOT/new_page_files/map/images/cricle.png' class='circleactive'>");
            $(this).attr("press","1")
        });



    })

</script>

</body>
</html>
<script type="text/javascript" src="scripts/iot_chart.js?v=1"></script>
